package com.heatup.apt.management.taglibs;


import freemarker.core.Environment;
import freemarker.template.TemplateDirectiveBody;
import freemarker.template.TemplateDirectiveModel;
import freemarker.template.TemplateException;
import freemarker.template.TemplateModel;

import java.io.IOException;
import java.util.Map;

/**
 * Created by earvin on 2017/7/17.
 */
public class PermissionTag implements TemplateDirectiveModel
{

    @Override
    public void execute(Environment env, Map params, TemplateModel[] loopVars,
                        TemplateDirectiveBody body) throws TemplateException, IOException {


        if(hasPermission()){
            body.render(env.getOut());
        }else{
            env.getOut().write("");
        }

    }


    public boolean hasPermission(){
        return false;
    }

}
